/*
#
#  Copyright © 2014 The University of Texas System Board of Regents, All Rights Reserved.
#       Author:        The Systems and Software Security (S3) Laboratory.
#         Date:        March 12, 2015
#      Version:        1.0.0
#
*/

#ifndef INSTRUMENTATION_ARGUMENTS_H
#define INSTRUMENTATION_ARGUMENTS_H



typedef enum { 
  IPOINT_INVALID, 
  IPOINT_BEFORE, 
  IPOINT_AFTER, 
  IPOINT_ANYWHERE, 
  IPOINT_TAKEN_BRANCH 
} IPOINT;

typedef enum { 
  CALL_ORDER_FIRST = 100, 
  CALL_ORDER_DEFAULT = 200, 
  CALL_ORDER_LAST = 300 
} CALL_ORDER;

typedef enum { 
  IARG_INVALID, 
  IARG_ADDRINT, 
  IARG_PTR, 
  IARG_BOOL, 
  IARG_UINT32, 
  IARG_INST_PTR, 
  IARG_REG_VALUE, 
  IARG_REG_REFERENCE, 
  IARG_REG_CONST_REFERENCE, 
  IARG_MEMORYREAD_EA, 
  IARG_MEMORYREAD2_EA, 
  IARG_MEMORYWRITE_EA, 
  IARG_MEMORYREAD_SIZE, 
  IARG_MEMORYWRITE_SIZE, 
  IARG_MEMORYREAD_PTR, 
  IARG_MEMORYREAD2_PTR, 
  IARG_MEMORYWRITE_PTR, 
  IARG_MEMORYOP_PTR, 
  IARG_MULTI_MEMORYACCESS_EA, 
  IARG_BRANCH_TAKEN, 
  IARG_BRANCH_TARGET_ADDR, 
  IARG_FALLTHROUGH_ADDR, 
  IARG_EXECUTING, 
  IARG_FIRST_REP_ITERATION, 
  IARG_PREDICATE, 
  IARG_STACK_VALUE, 
  IARG_STACK_REFERENCE, 
  IARG_MEMORY_VALUE, 
  IARG_MEMORY_REFERENCE, 
  IARG_SYSCALL_NUMBER, 
  IARG_SYSARG_REFERENCE, 
  IARG_SYSARG_VALUE, 
  IARG_SYSRET_VALUE, 
  IARG_SYSRET_ERRNO, 
  IARG_FUNCARG_CALLSITE_REFERENCE, 
  IARG_FUNCARG_CALLSITE_VALUE, 
  IARG_FUNCARG_ENTRYPOINT_REFERENCE, 
  IARG_FUNCARG_ENTRYPOINT_VALUE, 
  IARG_FUNCRET_EXITPOINT_REFERENCE, 
  IARG_FUNCRET_EXITPOINT_VALUE, 
  IARG_RETURN_IP, 
  IARG_ORIG_FUNCPTR, 
  IARG_PROTOTYPE, 
  IARG_THREAD_ID, 
  IARG_CONTEXT, 
  IARG_CONST_CONTEXT, 
  IARG_PARTIAL_CONTEXT, 
  IARG_PRESERVE, 
  IARG_RETURN_REGS, 
  IARG_CALL_ORDER, 
  IARG_REG_NAT_VALUE, 
  IARG_REG_OUTPUT_FRAME_VALUE, 
  IARG_REG_OUTPUT_FRAME_REFERENCE, 
  IARG_IARGLIST, 
  IARG_FAST_ANALYSIS_CALL, 
  IARG_SYSCALL_ARG0, 
  IARG_SYSCALL_ARGBASE = IARG_SYSCALL_ARG0, 
  IARG_SYSCALL_ARG1, 
  IARG_SYSCALL_ARG2, 
  IARG_SYSCALL_ARG3, 
  IARG_SYSCALL_ARG4, 
  IARG_SYSCALL_ARG5, 
  IARG_SYSCALL_ARGLAST = IARG_SYSCALL_ARG5, 
  IARG_G_RESULT0, 
  IARG_G_RETBASE = IARG_G_RESULT0, 
  IARG_G_RESULTLAST = IARG_G_RESULT0, 
  IARG_G_ARG0_CALLEE, 
  IARG_G_ARGBASE_CALLEE = IARG_G_ARG0_CALLEE, 
  IARG_G_ARG1_CALLEE, 
  IARG_G_ARG2_CALLEE, 
  IARG_G_ARG3_CALLEE, 
  IARG_G_ARG4_CALLEE, 
  IARG_G_ARG5_CALLEE, 
  IARG_G_ARGLAST_CALLEE = IARG_G_ARG5_CALLEE, 
  IARG_G_ARG0_CALLER, 
  IARG_G_ARGBASE_CALLER = IARG_G_ARG0_CALLER, 
  IARG_G_ARG1_CALLER, 
  IARG_G_ARG2_CALLER, 
  IARG_G_ARG3_CALLER, 
  IARG_G_ARG4_CALLER, 
  IARG_G_ARG5_CALLER, 
  IARG_G_ARGLAST_CALLER = IARG_G_ARG5_CALLER, 
  IARG_MEMORYOP_EA, 
  IARG_MEMORYOP_MASKED_ON, 
  IARG_TSC, 
  IARG_FILE_NAME, 
  IARG_LINE_NO, 
  IARG_LAST 
} IARG_TYPE;

#define IARG_END -1

typedef enum { 
  PIN_MEMOP_LOAD, 
  PIN_MEMOP_STORE 
} PIN_MEMOP_ENUM;


typedef VOID(* AFUNPTR)(VOID);


#endif
